package cn.wolfcode.trip.app;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * @author Wangyk
 * @date 2019/1/18 21:08
 * swagger的配置对象
 */
@Configuration
@EnableSwagger2
public class SwaggerConfig {

    /**
     * 把一个Docker交给spring管理
     * Docket：springfox提供的文档的配置对象；
     *
     * @return
     */
    @Bean
    public Docket api() {
        return new Docket(DocumentationType.SWAGGER_2).select().build();
    }
}